#include <stdio.h>
#define ROW 5
#define COLUMN 5
int main(void)
{
    int matrix[ROW][COLUMN] = {0};
    for (int i = 0; i < ROW; i++) {
        printf("Enter Student%d's scores(%d subjects): ", i + 1, COLUMN);
        for (int j = 0; j < COLUMN; j++)
            scanf("%d", &matrix[i][j]);
    }

    for (int i = 0; i < ROW; i++) {
        int sum = 0;
        for (int j = 0; j < COLUMN; j++)
            sum += matrix[i][j];
        printf("Student%d's sum: %d, avg: %.2f\n", i + 1, sum, (float)sum / COLUMN);
    }

    for (int i = 0; i < COLUMN; i++) {
        int sum = 0, max = 0, min = 100;
        for (int j = 0; j < ROW; j++) {
            sum += matrix[j][i];
            if (matrix[j][i] > max)
                max = matrix[j][i];
            if (matrix[j][i] < min)
                min = matrix[j][i];
        }
        printf("subject %d max: %d, min: %d, avg: %.2f\n", i + 1, max, min, (float)sum / COLUMN);
    }
    return 0;
}